package me.zhengjie.modules.system.service;

import me.zhengjie.modules.system.domain.DictDetail;
import me.zhengjie.modules.system.service.dto.DictDTO;
import me.zhengjie.modules.system.service.dto.DictDetailDTO;
import me.zhengjie.modules.system.service.dto.DictDetailQueryCriteria;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
* @author Zheng Jie
* @date 2019-04-10
*/
public interface DictDetailService {

    /**
     * findById
     * @param id
     * @return
     */
    DictDetailDTO findById(Long id);

    /**
     * create
     * @param resources
     * @return
     */
    DictDetailDTO create(DictDetail resources);

    /**
     * update
     * @param resources
     */
    void update(DictDetail resources);

    /**
     * delete
     * @param id
     */
    void delete(Long id);

    Object queryAll(DictDetailQueryCriteria criteria, Pageable pageable);

    List<DictDetailDTO> findByDeptId(int deptId);

    boolean isDictDeailExists(Long dictId, String label) ;

    /**
     * 根据字典类型,字典标签/值查重
     * @param dictId
     * @param label
     * @param value
     * @return
     */
    List<DictDetail> findByLabelOrValue(Long dictId, String label, String value);

    /**
     * 获取全部的字典明细
     * @param criteria
     * @return
     */
    List<DictDetail>  queryAll(DictDetailQueryCriteria criteria);
}